#http://www.mathchina.com/bbs/forum.php?mod=viewthread&tid=2044556&amp;page=1&;extra=#pid2395817
a=[[1], [[1,2]], [[1,2,3]]]

# 求各 ai 严格递增的解
if true
	b = [[1,2,3]]
	fa = 3; fb = 5;
	for k=4:18
			global b, fa, fb
			result = []; t = 0;
			for u=1:length(b)
					for i=1:length(b[u])-1
							t1 = b[u][i]
							for j=length(b[u]):-1:i+1
									t2 = b[u][j]
									s = t1 + t2
									if s > b[u][end] && s > fa*0.618
											tp = copy(b[u]); tp = append!(tp, s); 
											append!(result, [tp])
									else
											break
									end   
							end
					end
			end
			b=unique(result)
			sort!(b, lt=(x, y)->isless(x[end], y[end]))
			for j=1:length(b)
					if b[j][end] <= fa
						continue
					end
					
					t += 1
					if j == length(b) || b[j][end] < b[j+1][end]
							#println("k = $k, $(b[j])")
							println("n = $(b[j][end]), k = $k, sol = $t")
							t = 0
					else
							#println("k = $k, $(b[j])")
					end   
			end
			fb, fa = fb + fa, fb
	end
end

